import request from '@/utils/request'
import { getToken } from "@/utils/auth";

// 查询实验报告列表
export function listExperiment(query) {
  return request({
    url: '/oil/experiment/list',
    method: 'get',
    params: query
  })
}

// 查询实验报告详细
export function getExperiment(id) {
  return request({
    url: '/oil/experiment/' + id,
    method: 'get'
  })
}

// 新增实验报告
export function addExperiment(data) {
  return request({
    url: '/oil/experiment',
    method: 'post',
    data: data
  })
}

// 修改实验报告
export function updateExperiment(data) {
  return request({
    url: '/oil/experiment',
    method: 'put',
    data: data
  })
}

// 删除实验报告
export function delExperiment(id) {
  return request({
    url: '/oil/experiment/' + id,
    method: 'delete'
  })
}

// 上传文件
export function uploadBookFile(data) {
  return request({
    url: '/oil/experiment/uploadFile',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data',
      'Authorization': "Bearer " + getToken(),
    }
  })
}

